package core.command
{
	import core.event.SocketEventID;
	import core.event.UnoEvent;
	import core.event.ViewEventID;

	public class PlayCardUpdataCommand extends SuperCommand
	{
		public function PlayCardUpdataCommand()
		{
			socketEvent = SocketEventID.PLAY_CARD_UPDATE;
			viewEvent = ViewEventID.PLAY_CARD_UPDATE;
		}
		
		override public function success(e:UnoEvent):void
		{
			if(e.data.type == "normal")
			{
				//正常出牌
				var obj:Object = db.tableList[db.loginUser.table].config[e.data.seatID];
				obj.cards = (int(obj.cards) - 1).toString();
			}
			else if(e.data.type == "rule")
			{
				var seat:Object = db.tableList[db.loginUser.table]["config"][e.data.seatID];
				seat["cards"] = int(seat["cards"]) + int(e.data.card);
				trace("adfasd");
			}
			else
			{
				//罚牌
				//todo
				trace(435);
			}
		}
	}
}